<extend name="Base/common"/>

<block name="body">

	<body style="background:#4ea3fd;">

		<!--注册-->

		<div id="zhuc" style="height:100%;position: relative;">

			<form action="{:U('register')}" class="form-horizontal form"  method="post" style="position:absolute;top:50%;margin-top:-270px;padding:0;">

				<div class="number">

					<label><img src="__IMG__/images/login_03.png"/></label>

					<input type="text" class="input-reg test" id="number" name="mobile" placeholder="请输入手机号" maxlength="11" />

				</div>

				<div class="password">

					<label><img src="__IMG__/images/login1_07.png"/></label>

					<input type="password" class="input-reg" id="password" name="password" placeholder="输入密码" />

				</div>

				<div class="password">

					<label><img src="__IMG__/images/login1_07.png"/></label>

					<input type="password" class="input-reg" id="password" name="topassword" placeholder="确认密码" />

				</div>

				<div class="password">

					<input type="text" class="input-reg yzm-text" id="password" name="con" placeholder="验证码" style="width:360px; float:left;text-indent:50px;" />

					<input type="button" id="setime" class="click-yzm"  onclick="settime(this)" value="获取验证码" style="width:190px; float:right;">

					

				</div>

				<!-- <div class="password">

					<label><img onclick="this.src=this.src+'&'+Math.random()" class="userverify"  alt="点击切换" src="{:U('UserMember/verify')}"></label>

					<input type="password" name="verify" class="input-reg inputyzm" id="password" placeholder="点击切换验证码" />

				</div> -->

				<p style="text-align: center;font-size: 2.2rem;color: white;">

					<input type="checkbox" class="check" name="check" value="1" style="width:20px;height:20px;vertical-align:top;margin-top: 12px;margin-right: 12px;" /><span class="agree" style="font-size:25px;">我同意“全民教学”</span>《<a href="__CONTROLLER__/agreement" style="color: lightblue;text-decoration: underline;font-size:25px;">用户使用协议</a>》

				</p>

				<input type="submit" class="ajax-post" target-form="form-horizontal" name="buto" id="btn" value="注册" />

			</form>

		</div>

		<script>

                    $('.test').on('blur',function(){

                        var mobile = $('#number').val();

                        $.ajax({

					url: "{:U('UserMember/ajaxYzm')}",

					type: 'GET',

					dataType: 'json',

					data: {mobile: mobile},

					success:function(data){

						layer.msg(data);

                                                if(data == "该手机号已经注册"){

                                                    $("#setime").attr("onclick","test();");

                                                    $(".click-yzm").unbind( "click" )

                                                }

					}

				});

                    });

		var countdown=60;

			function settime(obj) {

			    if (countdown == 0) {

			        obj.removeAttribute("disabled");

			        obj.value="获取验证码";

			        countdown = 60;

					return;

			    } else {

			        obj.setAttribute("disabled", true);

			        obj.value="重新发送(" + countdown + ")";

			        countdown--;

			    }

			setTimeout(function() {

			    settime(obj) }

			    ,1000)

			}                      

			$('.click-yzm').on('click',function(){

				var mobile = $('#number').val();

				$.ajax({

					url: "{:U('UserMember/ajaxYzm',array('bj'=>1))}",

					type: 'POST',

					dataType: 'json',

					data: {mobile: mobile},

					success:function(data){

						layer.msg(data);

					}

				});

			});



			//勾选同意

			/*$('.agree').click(function(){

				var obj = $(this).prev('input');

				if (obj.is(':checked')) {

					obj.prop('checked',false);

					$('#btn').slideUp('400');



				} else {

					obj.prop('checked',true);

					$('#btn').slideDown('400');

				}

			});*/

		</script>

	</body>

</block>